/*
 * mysqltest.cpp
 *
 *  Created on: Apr 18, 2012
 *      Author: songbo
 */

#include <iostream>
#include <mysql.h>
#include <string>
using namespace std;
int main()
{
     MYSQL mysql;
     mysql_init(&mysql);
     mysql_real_connect(&mysql, "localhost", "mysql", NULL, "test", 3306, NULL, 0);
     string sql = "insert into t1 (id, name) values (2, 'java1');";
     mysql_query(&mysql, sql.c_str());
     mysql_close(&mysql);
}


